<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "topic".
 *
 * @property integer $id
 * @property string $topic_name
 * @property string $topic_author
 * @property string $topic_des
 * @property string $topic_tags
 * @property string $created_at
 * @property string $updated_at
 * @property string $topic_node_time
 * @property integer $topic_node_index
 * @property integer $topic_viewcount
 * @property integer $topic_comment_id
 * @property integer $topic_recommend_id
 */
class Topic extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'topic';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['topic_name', 'topic_author', 'topic_des', 'topic_tags', 'created_at', 'topic_node_time', 'topic_node_index'], 'required'],
            [['topic_node_index', 'topic_viewcount', 'topic_comment_id', 'topic_recommend_id'], 'integer'],
            [['topic_name', 'topic_author', 'topic_des', 'topic_tags'], 'string', 'max' => 255],
            [['topic_name'], 'unique']
        ];
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'topic_name' => '话题名称',
            'topic_author' => '话题创建者',
            'topic_des' => '话题描述',
            'topic_tags' => '话题标签',
            'created_at' => '创建时间',
            'updated_at' => '上一次更新',
            'topic_node_time' => '话题时间标记',
            'topic_node_index' => '话题所属时间轴index',
            'topic_viewcount' => '话题浏览量',
            'topic_comment_id' => '话题评论列表',
            'topic_recommend_id' => '话题推荐列表',
        ];
    }
}
